#lang racket
(define delta 0.0001)
(define (sqrt-recursion guess x good-func)
  (if (good-func guess x)
      guess
      (sqrt-recursion (improve guess x)
            x good-func)
  )
)

(define (good guess x)
  (< (abs (- (square guess) x)) delta))
;a improve good method for sqrt
(define (good2 guess x)
  (< (/ (abs (- (improve guess x)
                guess))
        guess)
     delta))

(define (improve guess x)
  (/ (+ guess (/ x guess)) 2))

(define (sqrt x)
  (sqrt-recursion 1.0 x good))

(define (sqrt2 x)
  (sqrt-recursion 1.0 x good2))

(define (square x)
  (* x x))
